#ifndef CALCULATEDCRC_H
#define CALCULATEDCRC_H
#include <string>
#include <memory>
#include <mutex>
#include <QString>
#include <QCryptographicHash>
class CalculatedCRC
{
public:
    ~CalculatedCRC();
    CalculatedCRC(const CalculatedCRC &) = delete;
    CalculatedCRC& operator=(const CalculatedCRC&) = delete;
    static  CalculatedCRC& GetInstance();
    //CRC校验
    QString  calculateCRC32(const QString &data);
    //CRC校验
    bool   verfyCRC32(const QString& dataWithCRC);
private:
    CalculatedCRC();

    static std::unique_ptr<CalculatedCRC> m_InStance;
    static std::once_flag m_Flag;

    QString m_Crc; //crc返回值
};

#endif // CALCULATEDCRC_H
